<include file="Public:header" />
<!--添加文章-->
<form id="info_form" action="{:U('UserMessage/add')}" method="post" enctype="multipart/form-data">
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">发送消息</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<table width="100%" cellspacing="0" class="table_form">
		            <tr>
						<th>发送对象 :</th>
						<td>
                            <input type="radio" name="touser" value="1" id="all" checked onclick="selectType(1);"/><label for="all">所有</label>
                            <input type="radio" name="touser" value="2" id="cateuser" onclick="selectType(2);"/><label for="cateuser">指定分类</label>
                            <input type="radio" name="touser" value="3" id="oneuser" onclick="selectType(3);"/><label for="oneuser">指定会员</label>
                        </td>
					</tr>
                    <tr id="to-2" style="display: none;">
                        <th>选择分类 :</th>
                        <td>
                            <select class="J_usercate_select mr10" data-pid="0" data-uri="{:U('UserCate/ajax_getchilds')}" data-selected=""></select>
                            <input type="hidden" name="user_cate" id="user_cateid" value="" />
                        </td>

                    </tr>
                    <tr id="to-3" style="display: none;">
                        <th>选择会员 :</th>
                        <td>
                            <span id="username"></span>
                            <button class="J_showdialog" data-pic="0" data-uri="{:U('User/publicSelect', array('menuid'=>$menuid))}" data-zindex="9999999" data-acttype="ajax" data-title="选择会员" data-id="select" data-width="570" data-height="250" data-boxtype="radio" data-boxname="userid" data-val="user_id" data-displaybox="username">选择会员</button>
                            <input type="hidden" name="user_id" id="user_id" value="{$userid}">
                        </td>
                    </tr>
                    <tr>
                        <th>标题 :</th>
                        <td><input type="text" name="title" class="input-text" size="60"></td>
                    </tr>
                  	<tr>
						<th>内容 :</th>
		                <td><script id="info" name="content" type="text/plain"></script></td>
					</tr>
				</table>
			</div>


        </div>
		<div class="mt10"><input type="submit" value="{:L('submit')}" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
	</div>
</div>
</form>
<include file="Public:footer" />
<script>
    $('.J_cate_select').cate_select({'field':'J_cate_id','id':'J_cate_select'});
    $('.J_usercate_select').cate_select({'field':'user_cateid','id':'J_usercate_select'});
</script>
<js file="__STATIC__/ueditor/ueditor.config.js" charset="utf-8" />
<js file="__STATIC__/ueditor/ueditor.all.min.js" charset="utf-8" />
<js file="__STATIC__/ueditor/lang/zh-cn/zh-cn.js" charset="utf-8" />
<script type="text/javascript">
    window.UEDITOR_HOME_URL='__STATIC__/ueditor/';
    window.onload=function(){
        window.UEDITOR_CONFIG.initialFrameWidth=880;
        window.UEDITOR_CONFIG.initialFrameHeight=500;
        UE.getEditor('info');
    };
    function selectType(id){
        switch(id){
            case 1:
                $("#to-2").hide();
                $("#to-3").hide();
                break;
            case 2:
                $("#to-3").hide();
                $("#to-2").show();
                break;
            case 3:
                $("#to-2").hide();
                $("#to-3").show();
                break;
        }
    }
</script>
</body>
</html>